package com.wuyong.chapter8;

import java.util.Comparator;
import java.util.PriorityQueue;

public class LeetCode347 {

    private class Freq implements Comparable<Freq>{
        int e, freq;

        public Freq(int e, int freq) {
            this.e = e;
            this.freq = freq;
        }

        @Override
        public int compareTo(Freq other) {
            if (this.freq < other.freq)
                return -1;
            else if (this.freq > other.freq)
                return 1;
            else
                return 0;
        }
    }
    public static void main(String[] args) {
        PriorityQueue<Freq> pq = new PriorityQueue<>(new Comparator<Freq>() {
            @Override
            public int compare(Freq o1, Freq o2) {
                return o1.freq - o2.freq;
            }
        });
    }
}
